package com.mikao.dao;

import com.mikao.entity.MoneyDetail;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

public interface MoneyDetailDao extends JpaRepository<MoneyDetail, Long>, JpaSpecificationExecutor {

    /**
     * 根据用户ID和类型查看资金明细
     *
     * @param userId 用户ID
     * @param type   类型
     * @return list
     */
    List<MoneyDetail> findAllByUserIdAndTypeOrderByCreateTimeDesc(Long userId, Integer type);
}
